import { Player } from "../db/Player";
import { BaseRequest, BaseResponse } from "./base";

/**
 * 用户登录
 */
export interface ReqPlayerLogin extends BaseRequest {
    /**登录id,或者openId */
    openId?:string,
    /**从微信登录获得的code用于获取微信小游戏的openId */
    code?:string,
    /**登录参数 */
    loginData: Pick<Player,'platform' | 'nickName' | 'avatarUrl' | 'channel'>;
}


export interface ResPlayerLogin extends BaseResponse {
    /**登录返回用户数据 */
    loginData: Omit<Player, "_id" | "registerTime" | "lastLoginTime" | "lastGoldReceiveTime" | "lastEnergyReceiveTime" | "goldPool" | "lastSignTime" | "hasFirstOpenBox">,
    /**下次能领的时间间隔 */
    nextEnergyTime:number,
    /**金币池数据 */
    poolData: {
        /**当前池子里的金币数 */
        goldPool:number,
        /**下次刷新金币池需要时间 */
        nextTime:number
    }
}